package io.renren.modules.map.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.map.dao.MaptableDao;
import io.renren.modules.map.entity.MaptableEntity;
import io.renren.modules.map.service.MaptableService;

@Service("maptableService")
public class MaptableServiceImpl extends ServiceImpl<MaptableDao, MaptableEntity> implements MaptableService {

    @Autowired
    MaptableDao maptableDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<MaptableEntity> page = this.page(
                new Query<MaptableEntity>().getPage(params),
                new QueryWrapper<MaptableEntity>().like("map_name",(String)params.get("key"))
        );

        return new PageUtils(page);
    }

    @Override
    public int updatestatus(String mapNo) {
        return maptableDao.updatestatus(mapNo);
    }

}